﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Security.Cryptography;
using System.IO;
using System.Text;

namespace MetroDropBox.Shared
{
    public static class SHA1EncryptionHelper
    {
        public static String HMACSha1Sign(String key, String signThis)
        {
            HMACSHA1 crypto = null;
            CryptoStream cryptoStream = null;
            try
            {
                crypto = new HMACSHA1(Encoding.UTF8.GetBytes(key));
                var hash = crypto.ComputeHash(Encoding.UTF8.GetBytes(signThis));
                var result = Convert.ToBase64String(hash);
                return result;
            }
            finally
            {
            }
            return "";
        }
    }
}
